using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TimeTrack
{
	public partial class FormTagInput : Form
	{
		NoteTag m_NoteTag;

		public FormTagInput()
		{
			InitializeComponent();

			m_NoteTag.BackColor = btnColor.BackColor;
			m_NoteTag.Checked = true;
		}

		public string TagName
		{
			set
			{
				m_NoteTag.Name = BoxTagName.Text = value;
			}
		}

		public Color TagColor
		{
			set
			{
				BoxTagName.BackColor = btnColor.BackColor = m_NoteTag.BackColor = value;
			}
		}

		public NoteTag NewNoteTag
		{
			get
			{
				m_NoteTag.Name = BoxTagName.Text;
				return m_NoteTag;
			}
		}

		private void btnColor_Click(object sender, EventArgs e)
		{
			using(ColorDialog oColorDialog = new ColorDialog())
			{
				oColorDialog.Color = btnColor.BackColor;
				if(oColorDialog.ShowDialog(this) == DialogResult.OK)
				{
					BoxTagName.BackColor = btnColor.BackColor = m_NoteTag.BackColor = oColorDialog.Color;
				}
			}
		}
	}
}